package com.yys.gulimall.member.web;

import com.yys.common.utils.R;
import com.yys.gulimall.member.feign.OrderFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zq
 * @version 1.0
 * @date 2021/4/7 15:06
 */
@Controller
public class MemberWebController {

    @Autowired
    private OrderFeignService orderFeignService;

    @GetMapping("/memberOrder.html")
    public String memberOrderPage(@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum, Model model) {
        HashMap<String, Object> param = new HashMap<>();
        param.put("page",pageNum.toString());
        R r = orderFeignService.listWithItem(param);
        model.addAttribute("orders",r);

        return "orderList";
    }
}
